﻿#ifndef COMMUNICATIONPROTOCOL_H
#define COMMUNICATIONPROTOCOL_H

#include "QObject"
#include "UpwardPro_global.h"
#include <qDebug>
typedef void (*ReceiveDataCallback)(const char data[]);

class UPWARDPRO_EXPORT CommunicationProtocol : public QObject {
    Q_OBJECT
public:
    CommunicationProtocol();
    virtual int protocolParaInit(void* para_struct) = 0;
    virtual int protocolOpen() = 0;
    virtual int protocolClose() = 0;
    virtual int protocolWrite(const QByteArray& data_buf) = 0;
    virtual void setProtocolReadCallbackFunc(ReceiveDataCallback callBackFunc) = 0;
    virtual ~CommunicationProtocol();
};

#endif // COMMUNICATIONPROTOCOL_H
